<template>
  <view>
    <view>
      <view class="u-m-l-30 u-m-r-30 u-m-t-30" v-if="list.length > 1">
        <u-subsection
          :list="list"
          v-model="current"
          bg-color="#cccccc"
        ></u-subsection>
      </view>
      <view v-for="item in list" :key="item.taskId">
        <template v-if="item.taskId === list[current].taskId">
          <fileList :taskInfo="item"></fileList>
        </template>
      </view>
    </view>
  </view>
</template>
<script lang="ts" setup>
import fileList from '@/components/fileList/index.vue';
const props = defineProps<{
  contractInfo: any;
}>();
const current = ref<number>(0);
const list = computed(() => {
  let _arr = [];
  if (contractInfo.value.hasContract) {
    _arr = [
      {
        name: '合同',
        taskId: contractInfo.value.taskId,
        isCommonDetail: true,
      },
      {
        name: '纸质合同',
        taskId: contractInfo.value.contractPaperId,
        isCommonDetail: true,
      },
    ];
  } else {
    _arr = [
      {
        name: '合同',
        taskId: contractInfo.value.taskId,
        isCommonDetail: true,
      },
    ];
  }
  return _arr;
});
const { contractInfo } = toRefs(props);
</script>
